//
//  UILabel+create.m
//  KSBridgeDesign
//
//  Created by huzhaoke on 2021/4/24.
//

#import "UILabel+create.h"

@implementation UILabel (create)

+ (UILabel *)labelWithFont:(UIFont *)font
                   bgColor:(UIColor *)bgColor
                 textColor:(UIColor *)textColor
              textAligment:(NSTextAlignment)textAligment{
    UILabel *label = [[UILabel alloc] init];
    label.font = font ? : [UIFont systemFontOfSize:14.F];
    label.backgroundColor = bgColor?:[UIColor clearColor];
    label.textAlignment = textAligment?:NSTextAlignmentLeft;
    label.textColor = textColor ? : [UIColor blackColor];
    return label;
}

+ (UILabel *)labelWithFont:(UIFont *)font
                   bgColor:(UIColor *)bgColor
                 textColor:(UIColor *)textColor
              textAligment:(NSTextAlignment)textAligment
               configBlock:(void (^)(UILabel *label))configLabelBlock {
    UILabel *label = [self labelWithFont:font
                                 bgColor:bgColor
                               textColor:textColor
                            textAligment:textAligment];
    if (configLabelBlock) {
        configLabelBlock(label);
    }
    return label;
}

@end
